package work.shyk.cdp.xmlDemo;

import work.shyk.cdp.xmlDemo.dto.SlaveEntity;
import work.shyk.cdp.xmlDemo.dto.SlavesEntity;

import java.util.LinkedList;

/**
 * description: <br>
 * createTime: 2020/10/2015:44 <br>
 *
 * @author zzh
 */
public class SlavesTest {

    public static void main(String[] args) {
        SlavesEntity slavesEntity = new SlavesEntity();
        SlaveEntity slaveEntity = new SlaveEntity();
        slaveEntity.setHost("123");
        slaveEntity.setPort("345");
        slaveEntity.setRemoteResultPath("567");
        slaveEntity.setUserName("zhangsan");
        LinkedList list = new LinkedList();
        list.add(slaveEntity);
        slavesEntity.setEntityList(list);
        System.out.println("---将对象转换成string类型的xml Start---");
        // 将对象转换成string类型的xml
        String str = XMLUtil.convertToXml(slavesEntity);
        // 输出
        System.out.println(str);
        System.out.println("---将对象转换成string类型的xml End---");
    }
}
